home *** CD-ROM | disk | FTP | other *** search
- -- colorizeHC "colorFill", "221,160,303,229", "5243,65535,65535"
- -- "5243,65535,65535" <--This is the current color
- -- 221,160,303,229 <--- This is the current coloring rect
-
- on mouseUp
- if the commandkey is down then
- newColor
- exit mouseup
- end if
- if the optionkey is down then
- locateMe
- readytoScript
- exit mouseup
- end if
- if the shiftKey is down then
- deleteLastColor
- exit mouseup
- end if
- togglecolor
- end mouseUp
-
-
- on locateMe
- put "--" && "colorizeHC" && quote & "colorFill" & quote & "," && quote & the rect of ¬
- me & quote & "," && word 2 of line 2 of the script of me into insertLine
- put the script of me into holdScript
- put line 1 of insertLine into line 1 of holdScript
- put "-- " && the rect of me && "<--- This is the current coloring rect"into line 3 of holdScript
- set the script of me to holdScript
- end locateMe
-
- on toggleColor
- set the lockscreen to true
- locateme
- if the showName of me is true then
- put line 1 of the script of me into colorCommand
- delete word 1 of colorCommand
- do colorCommand
- set the showName of me to false
- go to this cd
- else
- set the lockscreen to true
- colorizeHC "Erase", rect of me
- set the showName of me to true
- go to this cd
- end if
- end toggleColor
-
- on newColor
- global TheColor
- put "65535,4944,44180" into TheColor
- put colorPicker("Choose a color.","",TheColor) into TheColor
- if TheColor is empty then exit newColor
- if the result is not empty then answer the result
- updateColor
- end newcolor
-
- on updateColor
- global TheColor
- colorizeHC "colorFill",rect of me, TheColor
- put the script of me into holdScript
- put "-- colorizeHC" && "colorFill" & "," & quote && rect of me & quote & "," && quote & TheColor & quote into line 1 of holdScript
- put "-- " && quote & TheColor & quote && " <--This is the current color" into line 2 of holdScript
- set the script of me to holdScript
- locateMe
- go this cd
- put "Your Crayon is magically changed to RGB color:" && TheColor
- end updateColor
-
- on deletebutton
- colorizeHC "erase", the rect of me
- end deletebutton
-
-
- on readytoScript
- global holdScript
- set cursor to watch
- put "Now checking all scripts..."
- global holdScript
- global colorauthoringpath
- get offset ("makeitcolor", the script of this stack)
- if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
- get offset ("on makeitcolor", the script of this bg)
- if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
- get offset ("on makeitcolor", the script of this cd)
- if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath)
- set the showname of me to true
- togglecolor
- put line 1 of the script of me into line 1 of insertLine
- delete word 1 of insertLine
- put the name of me into check
- if word 1 of check is "bkgnd" then
- put the script of this bg into holdScript
- put "bg" into wheretoGo
- put "send makeitcolor to this cd" into whattoSee
- put the name of this bg into myName
- end if
- if word 1 of check is "card" then
- put the script of this cd into holdScript
- put "cd" into wheretoGo
- put "end makeitcolor" into whattoSee
- put the name of this cd into myName
- end if
-
- get offset (insertLine, holdScript)
- if it is not "0" then
- answer "This color has already been added here. Do you want to convert this to an ordinary button now?"¬
- with "Yes" or "No"
- if it is "Yes" then
- do showdialog 3, "510", , ,"Untitled" , "7",,
- if the result is empty then exit readytoscript
- put the result into hold
- if line 1 of hold is "6" then set the style of me to "Transparent"
- if line 1 of hold is "5" then
- put word 1 to 2 of the name of me into hold
- put space & "id" && the id of me after last word of hold
- select hold
- domenu "Clear Button"
- choose browse tool
- set lockscreen to true
- opencard
- exit readytoscript
- end if
- set the name of me to line 2 of hold
- put "on mouseup" into line 1 of temp
- put " " into line 2 of temp
- put "end mouseup" into line 3 of temp
- set the script of me to temp
- end if
- exit readytoscript
- if it is "No" then exit readytoscript
- end if
- put quote & rect of me & quote into checkRegion
- get offset (checkRegion, holdScript)
- if it is "0" then
- do put offset (whattoSee, holdscript) into whereGo
- put insertLine & return before char whereGo of holdScript -- this should add the new colors
- do set the script of myName to holdScript
- do put "This color has been added to" && the name of wheretoGo into message
- answer "Do you want to convert this to an ordinary button now?"¬
- with "Yes" or "No"
- if it is "Yes" then
- do showdialog 3, "510", , ,"Untitled" , "7",,
- if the result is empty then exit readytoscript
- put the result into hold
- if line 1 of hold is "6" then set the style of me to "Transparent"
- if line 1 of hold is "5" then
- put word 1 to 2 of the name of me into hold
- put space & "id" && the id of me after last word of hold
- select hold
- domenu "Clear Button"
- choose browse tool
- set lockscreen to true
- opencard
- exit readytoscript
- end if
- set the name of me to line 2 of hold
- put "on mouseup" into line 1 of temp
- put " " into line 2 of temp
- put "end mouseup" into line 3 of temp
- set the script of me to temp
- end if
- exit readytoscript
- end if
- if it is not "0" then
- answer "You are painting in an area already painted. This is not necessarily a problem, but painting the same region twice will take longer." ¬
- with "Cancel" or "Continue"
- end if
- if it is "Cancel" then exit readytoScript
- if it is "Continue" then
- do put offset (whattoSee, holdscript) into whereGo
- put insertLine & return before char whereGo of holdScript -- this should add the new colors
- do set the script of myName to holdScript
- do put "This overlapping color has been added to" && the name of wheretoGo into message
- answer "Do you want to convert this to an ordinary button now?"¬
- with "Yes" or "No"
- if it is "Yes" then
- do showdialog 3, "510", , ,"Untitled" , "7",,
- if the result is empty then exit readytoscript
- put the result into hold
- if line 1 of hold is "6" then set the style of me to "Transparent"
- if line 1 of hold is "5" then
- put word 1 to 2 of the name of me into hold
- put space & "id" && the id of me after last word of hold
- select hold
- domenu "Clear Button"
- choose browse tool
- set lockscreen to true
- opencard
- exit readytoscript
- end if
- set the name of me to line 2 of hold
- put "on mouseup" into line 1 of temp
- put " " into line 2 of temp
- put "end mouseup" into line 3 of temp
- set the script of me to temp
- end if
- exit readytoscript
- end if
- end readytoScript
-
- on deleteLastColor
- put line 1 of the script of me into line 1 of insertLine
- delete word 1 of insertLine
- put the name of me into check
- if word 1 of check is "bkgnd" then
- put the script of this bg into holdscript
- put "bg" into wheretoGo
- put the name of this bg into myName
- else
- put the script of this cd into holdScript
- put "cd" into wheretoGo
- put the name of this cd into myName
- end if
- get offset (insertLine, holdScript)
- if it is 0 then
- answer "This color has already been deleted" with "Okay"
- exit deleteLastColor
- end if
- get offset ("colorFill", holdScript)
- if it is 0 then
- answer "You have already erased all the card colors" with "I knew that"
- exit deleteLastColor
- end if
- put the number of lines of char 1 to offset(insertLine, holdScript) ¬
- of holdscript into KillLine
- delete line KillLine of holdScript
- colorizeHC "Erase", rect of me
- go to this cd
- do put "This color has been removed from" && the name of wheretoGo into message
- do set the script of myName to holdScript
- end deleteLastColor